<script setup lang="ts">
// 作用域插槽：用于将数据传递给父组件
import { reactive } from "vue";
const data = reactive([
  { name: "张三", age: 18 },
  { name: "里斯", age: 19 },
  { name: "王五", age: 12 },
]);
</script>

<template>
  <div v-for="(item, idx) in data">
    <slot :data="item" :idx="idx"></slot>
  </div>

  <ul>
    <slot :list="data" name="format"></slot>
  </ul>
</template>

<style scoped></style>
